package demo_code;

public class User_Account {
    public static void main(String[] args) {

    }
}
 class User {
    private String name;   // 姓名
    private String email;   // 邮箱
    private String address;  // 地址
    private double balance; // 收入

    public void updateUserInfo(String name, String email, String address) {
        this.name = name;
        this.email = email;
        this.address = address;
        // 更新用户信息...
    }
   // 不遵循单一职责原则的代码实现
     //存款
    public void deposit(double amount) {
        this.balance += amount;
        // 存款操作...
    }
}
 //遵循单一职责原则的代码实现
 //账户信息类
 class Account {
    private double balance;
     //存款
    public void deposit(double amount) {
        this.balance += amount;
        // 存款操作...
    }
}
